package com.summer.bean;

import java.util.Objects;

/**
 * Created by IntelliJ IDEA.
 * Description:
 * User: 35391
 * Package: com.summer.pojo
 * Date: 2025/3/23
 * Time: 下午4:05
 * Version: 1.0
 */
public class User {
    private Integer id;
    private String username;
    private String password;
    private String sno;
    public User() {
    }
    public User(Integer id, String username, String password, String sno) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.sno = sno;
    }

    public User(String username, String sno) {
        this.username = username;
        this.sno = sno;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", password='" + password + '\'' +
                ", sno='" + sno + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(id, user.id) && Objects.equals(username, user.username) && Objects.equals(password, user.password) && Objects.equals(sno, user.sno);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, password, sno);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getSno() {
        return sno;
    }

    public void setSno(String sno) {
        this.sno = sno;
    }
}
